import Quick from ".";
import { WeaInput, WeaLocaleProvider } from 'ecCom';
const { getLabel } = WeaLocaleProvider;

export default class Main extends Quick {
    state = {
        fieldMark: '',
        splitChar: ''
    }
    getComponent = () => {
        const { fieldMark, splitChar } = this.state;
        return [
            <div>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@njymvn@`}
                    style={{ width: 200 }}
                    placeholder={getLabel('528639','请输入字段名称')}
                    value={fieldMark}
                    onChange={v => this.setState({ fieldMark: v })}
                />
            </div>,
            <div style={{marginTop:8}}>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@n0up38@`}
                    style={{ width: 200 }}
                    placeholder={getLabel('528645','请输入分隔符') }
                    value={splitChar}
                    onChange={v => this.setState({ splitChar: v })}
                />
            </div>
        ]
    }
    getTitle = () => {
        return 'excel.getBrowserShowName';
    }
    getScript = () => {
        return `excel.getBrowserShowName('${this.state.fieldMark}',${this.state.splitChar});`
    }
}